from charmicat import Cut

from cmix.parameters import paramdef

cuts = [Cut(name='low_q',
               desc='Events where the quantity Q is less than 50 MeV',
               pos_str='(q_pikpi < 0.05) & (q_pipik < 0.05)',
               ),
           Cut(name='slow_is_pos',
               desc='Events where the slow track is positive',
               pos_str='(slow_charge > 0)',
               ),
           Cut(name='slow_is_neg',
               desc='Events where the slow track is negative',
               pos_str='(slow_charge < 0)',
               ),           
           Cut(name='m_kpi_not_d0_4sig',
               desc="Events where M(K+pi-) is not within 4 sigma of the D0",
               pos_str="(abs(m_kpi - D0_MASS) > 4*D0_SIGMA_MC)",
               condvars=paramdef,
               ),
           Cut(name='m_pik_not_d0_4sig',
               desc="Events where M(K-pi+) is not within 4 sigma of the D0",
               pos_str="(abs(m_pik - D0_MASS) > 4*D0_SIGMA_MC)",
               condvars=paramdef,
               ),  
           Cut(name='eid_lt_0.1',
               desc='Reject electrons by eid for both tracks < 0.1',
               pos_str='(pos_eid < 0.1) & (neg_eid < 0.1)',
               ),           
           Cut(name='belle_ws_pid',
               desc='K+ by atc_pid(K,pi) > 0.5, pi- by atc_pid(K,pi) < 0.9',
               pos_str='(pos_kpi_llh > 0.5) & (neg_kpi_llh < 0.9)',
               ),           
           Cut(name='pcm_pikpi_gt_2.425',
               desc='Events where the CM momentum of the D* > 2.425 GeV',
               pos_str='(pcm_pikpi > 2.425)',
               ),
        Cut(name='gteq2_svd_hits',
            desc='Events with >=2 SVD hits in both z and rphi ' + \
            'for both fast tracks',
            pos_str= ' & '.join(['(wsk_svd_nhits_rphi > 1)',
                                 '(wsk_svd_nhits_rphi > 1)',
                                 '(rsk_svd_nhits_z > 1)',
                                 '(rsk_svd_nhits_z > 1)']),
            latex=r'$N_{SVD} > 2$',
            ),        
           ]




